package code;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * @author xiaovcloud
 * @description:
 * @since 2021/8/24 20:04
 */
public class JUCTest {

	public static void main(String[] args) {

		ConcurrentHashMap<String, String> concurrentHashMap = new ConcurrentHashMap<>(16);
		concurrentHashMap.put("abc","abc");
		System.out.println(concurrentHashMap.get("abc"));

		LinkedBlockingQueue<String> linkedBlockingQueue = new LinkedBlockingQueue<>(16);
		linkedBlockingQueue.offer("abc");
		System.out.println(linkedBlockingQueue.peek());

		CopyOnWriteArrayList<String> copyOnWriteArrayList = new CopyOnWriteArrayList<>();
		copyOnWriteArrayList.add("abc");
		System.out.println(copyOnWriteArrayList.get(0));

	}
}
